Skip to content

Add structured field, sourceKey, and line locations to validation issues - #276

Merged
mindsocket merged 1 commit into
mainfrom
feat/191-structured-issue-locations
Nov 30, 2026
Merged

mindsocket merged 1 commit into
mainfrom
feat/191-structured-issue-locations

Conversation

@mindsocket

Copy link
Copy Markdown
Owner

Closes #191

Summary

  • Add optional location?: { field?: string; sourceKey?: string; line?: number } to ValidationIssue (existing issue keys stay unchanged for compatibility).
  • Add optional fieldSources to ParseResult and ReadSpaceResult (keeping BaseNode / SpaceNode and SpaceGraphData v1 unchanged) and preserve/update it in refreshReadResult.
  • Extract frontmatter key/item JSON pointers, original sourceKey (reversing fieldMap), and 1-based line numbers in the markdown plugin using js-yaml's parseEvents (handles quoted keys, flow-style objects, nested objects, and array items).
  • Populate location on schema issues (including required missing properties, additionalProperties, and invalid types), broken-link issues, and hierarchy issues (also attaching source on hierarchy issues).
  • Rebuild plugin/types/index.d.ts via bun run build:mod-projection and add tests/validate/issue-locations.test.ts.

@claude

claude Bot commented Nov 30, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread src/plugins/markdown/util.ts Resolved
@mindsocket

Copy link
Copy Markdown
Owner Author

Switched extractYamlFieldSources to yaml (eemeli's zero-dependency YAML 1.2 AST parser) using parseDocument + LineCounter in 02f91e5 — replaces the ~115-line js-yaml parseEvents state machine with a ~30-line AST walk.

@mindsocket
mindsocket force-pushed the feat/191-structured-issue-locations branch from 02f91e5 to e63a9e6 Compare November 30, 2026 22:28
@mindsocket
mindsocket merged commit cca7729 into main Nov 30, 2026
2 checks passed
@mindsocket
mindsocket deleted the feat/191-structured-issue-locations branch November 30, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structured issue locations: field, source key and line

1 participant